import { createRouter, createWebHashHistory } from 'vue-router';
import Layout from '@/components/layout/BaseLayout';
import interceptor from './interceptor';
const routes = [
  {
    path: '/',
    redirect: '/loading',
    component: Layout,
    children: [
      {
        path: '/test',
        name: '测试二级页面（面包屑抓这个字段）',
        component: () => import(/* webpackChunkName: "test" */ '../views/Test.vue'),
      },
    ],
  },
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "login" */ '../views/Login.vue'),
  },
  {
    path: '/loading',
    name: 'Loading',
    component: () => import(/* webpackChunkName: "loading" */ '../views/Loading.vue'),
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});
interceptor(router);
export default router;
